<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>斐波那契数列</title>
</head>
<body>


<script>

//斐波那契数列


    function fbnq(n) {
        if(n == 1|| n == 2){
            return 1;
        }else{
            return fbnq(n - 2) + fbnq(n - 1);
        }
    }
    console.log(fbnq(25));




    /*var p = parseInt(prompt('请输入'));
    var third;
    var first = 1;
    var second = 1;

   if(p > 2){
       for(var i = 0;i < p -2;i++){
               third = first + second;
               first = second;
               second = third;
           }
   }else{
       third = 1;
   }
    console.log(third)
*/

</script>
</body>
</html>